package com.laysonx.easy.invoke.core;

import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.stereotype.Controller;

import java.util.Set;

/**
 * 扫描注册数据处理器（DataHandler、VerifyHandler、DisposeHandler）
 * @author: Laysonx
 * @date: 2019/9/27 10:58
 */
public class ControllerScanner extends ClassPathBeanDefinitionScanner {

    public ControllerScanner(BeanDefinitionRegistry registry) {
        super(registry, false);
    }

    public void registerFilters() {
        addIncludeFilter(new AnnotationTypeFilter(Controller.class));
    }

    @Override
    public Set<BeanDefinitionHolder> doScan(String... basePackages) {
        return super.doScan(basePackages);
    }
}